<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>省级疫苗补助查看</title>
	<meta name="decorator" content="default"/>
	<%--<link type="text/css" rel="stylesheet" href="${ctxCss}/common/table.css"/>--%>
	<script type="text/javascript" src="${ctxScript}/js/vaccine.js"></script>
	<script type="text/javascript">
		$(document).ready(function() {
            <%--if('${vaccine.state}' ==  -1){--%>
		        <%--var data ={--%>
                    <%--id:'${vaccine.id}',--%>
                    <%--state:'${vaccine.state}',--%>
                    <%--invoiceCode:'${vaccine.invoiceCode}',--%>
                    <%--invoiceNo:'${vaccine.invoiceNo}',--%>
                    <%--invoiceDate:'${vaccine.invoiceDate}',--%>
                    <%--totalAmount:'${vaccine.totalAmount}',--%>
                    <%--checkCode:'${vaccine.checkCode}'--%>
                <%--};--%>
                <%--checkReal(0,data);--%>
			<%--}--%>
		});
	</script>
	<style>
		.little-title{
			padding: 15px 0 10px 10px;
			font-size: 18px;
			margin-left: 3%;
			font-family:'Arial Normal','Arial';
			font-weight: 400;
			font-style: normal;
			color: #33A5E7;
			text-rendering: optimizeLegibility;
			font-kerning: normal;
		}

		.td_right{
			width: 11%;
			text-align:right;
		}
		.td_left{
			width: 20%;
			text-align:left;
		}.td_second{
            width:40%
         }
        body{
            padding-left: 50px;
        }
	</style>
</head>
<body>
	<form:form id="inputForm" modelAttribute="vaccine" action="" method="post" class="form-horizontal">
		<table class="tableStyle" formMode="view" style="width: 98%;margin-left: 1%">
			<c:if test="${ '0' == vaccine.auditStatus}">
				<c:choose>
					<c:when test="${vaccine.state == -2}">
						<div class="little-title" style="color: red">
							<img src="${ctxStatic}/images/u1368.png" style="width: 25px;height:25px;"/>&nbsp;&nbsp;系统提示</br>
							<p style="margin-left: 34px;">该发票照片识别失败，请注意审核！</p>
						</div>
					</c:when>
					<c:otherwise>
						<c:if test="${vaccine.entHistory.entName != vaccine.purchaserName}">
							<div class="little-title" style="color: red">
								<img src="${ctxStatic}/images/u1368.png" style="width: 25px;height:25px;"/>&nbsp;&nbsp;系统提示</br>
								<p style="margin-left: 34px;">该发票购买方名称与备案养殖场名称不符，请注意审核！</p>
							</div>
						</c:if>
					</c:otherwise>
				</c:choose>
			</c:if>
				<div class="little-title"><img src="${ctxStatic}/images/u268.png" style="width: 25px;height:25px;"/>&nbsp;&nbsp;基础信息</div>
				<tr>
					<td class="td_right viewModeEven">申请时间：</td>
					<td class="td_second"style=";text-align:left"><fmt:formatDate value="${vaccine.audit.submitDate}" pattern="yyyy-MM-dd"/></td>
					<td class="td_right viewModeEven">养殖场名称：</td>
					<td style=";text-align:left">${vaccine.entHistory.entName} </td>
				</tr>
				<tr>
					<td style=";text-align:right" class="viewModeEven">养殖种类：</td>
					<td style=";text-align:left">${vaccine.entHistory.farmType}</td>
				</tr>
		</table>
		<table class="tableStyle" formMode="view" style="width: 98%;margin-left: 1%;">
				<div class="little-title" style="float: left;"><img src="${ctxStatic}/images/u1334.png" style="width: 25px;height:25px;"/>&nbsp;&nbsp;发票信息

					<c:if test="${ '0' == vaccine.auditStatus}">
					<input class="btn btn-primary" style="background: #ff9933" type="button" value="校验真伪" onclick="checkInvoice('${vaccine.id}')"/>
					</c:if>
					<c:choose>
						<c:when test="${vaccine.state < 0 }"><p style="margin-top:5px;color: red;float: right;">(发票未验真)</p></c:when>
						<c:when test="${vaccine.state == 0}"><p style="margin-top:5px;color: red;float: right;">(无效发票)</p></c:when>
						<c:when test="${vaccine.state == 1}"><p style="margin-top:5px;color: green;float: right;">(有效发票)</p></c:when>
						<c:otherwise><p style="color: red;float: right;">(发票已作废)</p></c:otherwise>
					</c:choose>
				</div>
				<tr>
					<td class="td_right viewModeEven">发票编号：</td>
					<td class="td_second" style=";text-align:left">${vaccine.invoiceNo}</td>
					<td class="td_right viewModeEven">发票日期：</td>
					<td style=";text-align:left"><fmt:formatDate value="${vaccine.invoiceDate}" pattern="yyyy-MM-dd"/></td>
				</tr>
				<tr>
					<td style=";text-align:right" class="viewModeEven">生产厂家：</td>
					<td style=";text-align:left">${vaccine.factory}</td>
				</tr>
		</table>
			<c:forEach items="${vaccine.vaccineInfoList}" var="vaccineInfo" varStatus="a">
                <div class="little-title"><img src="${ctxStatic}/images/u284.png" style="width: 25px;height:25px;"/>&nbsp;&nbsp;疫苗信息</div>
                <table class="tableStyle" formMode="view" style="width: 98%;margin-left: 1%">
                    <tr>
						<td class="td_right viewModeEven"style=";text-align:right" class="viewModeEven">疫苗品种：</td>
						<td class="td_second" style=";text-align:left">${vaccineInfo.vaccineName}</td>
						<td class="td_right viewModeEven" style=";text-align:right" >疫苗数量：</td>
						<td style=";text-align:left">
							<c:choose>
						    <c:when test="${0 eq vaccineInfo.calcUnit}">
								${vaccineInfo.amountMl}ml
						    </c:when>
						    <c:otherwise>
								${vaccineInfo.amount}头份
						    </c:otherwise>
						</c:choose></td>
					</tr>
					<%--<tr>
						<td class="td_right viewModeEven"style=";text-align:right" class="viewModeEven">换算方式：</td>
						<td style=";text-align:left">${vaccineInfo.ml}ml/头份</td>
						<td class="" style=";text-align:right" class="viewModeEven">换算后：</td>
						<td style=";text-align:left">${vaccineInfo.amount}头份</td>
					</tr>--%>
					<tr>
						<td class="td_right viewModeEven"style=";text-align:right" class="viewModeEven">补助金额：</td>
						<td style=";text-align:left">${vaccineInfo.cash}元</td>
					</tr>
				</table>
			</c:forEach>
		<table class="tableStyle" formMode="view" style="width: 98%;margin-left: 1%">
			<div class="little-title"><img src="${ctxStatic}/images/u304.png" style="width: 25px;height:25px;"/>&nbsp;&nbsp;补助总额</div>
				<tr>
					<td class="td_right viewModeEven">补助总额：</td>
					<td style=";text-align:left">${vaccine.subsidyCash}元</td>
				</tr>
		</table>

		<table class="tableStyle" formMode="view" style="width: 98%;margin-left: 1%">
			<div class="little-title"><img src="${ctxStatic}/images/u348.png" style="width: 25px;height:25px;"/>&nbsp;&nbsp;附件信息</div>
				<tr>
					<td class="td_right viewModeEven">发票照片：</td>
					<c:forEach items="${vaccine.attachmentList}" var="attachment">
						<c:if test="${attachment.fileType=='invoice'}"	>
							<td style="width: 20%;text-align:left">
								<img id ='invoice' filePath="${attachment.filePath}" style="height: 127px;width: 200px"
									 src="${fns:getConfig('domain')}${attachment.filePath}?imageView2/2/w/200" onclick="viewPhoto(this)"></td>
						</c:if>
					</c:forEach>
				</tr>
				<tr>
					<td class="td_right viewModeEven">单瓶疫苗照片：</td>
					<c:forEach items="${vaccine.attachmentList}" var="attachment">
						<c:if test="${attachment.fileType=='front'}"	>
							<td style="width: 20%;text-align:left"><img src="${fns:getConfig('domain')}${attachment.filePath}?imageView2/2/w/200" style="height: 127px;width: 200px" onclick="viewPhoto(this)"></td>
						</c:if>
					</c:forEach>
				</tr>
				<tr>
					<td class="td_right viewModeEven">疫苗说明书照片：</td>
					<c:forEach items="${vaccine.attachmentList}" var="attachment">
						<c:if test="${attachment.fileType=='instructions'}"	>
								<td style="width: 20%;text-align:left"><img src="${fns:getConfig('domain')}${attachment.filePath}?imageView2/2/w/200" style="height: 127px;width: 200px" onclick="viewPhoto(this)"></td>
						</c:if>
					</c:forEach>
				</tr>
				<tr>
					<td class="td_right viewModeEven">免疫场景照片/免疫记录表照片：</td>
					<c:forEach items="${vaccine.attachmentList}" var="attachment">
							<c:if test="${attachment.fileType=='record'}"	>
							<td style="width: 20%;text-align:left"><img src="${fns:getConfig('domain')}${attachment.filePath}?imageView2/2/w/200" style="height: 127px;width: 200px" onclick="viewPhoto(this)"></td>
						</c:if>
					</c:forEach>
				</tr>
				<tr>
					<td class="td_right viewModeEven">抗体监测报告：</td>
					<c:forEach items="${vaccine.attachmentList}" var="attachment">
						<c:if test="${attachment.fileType=='report'}"	>
							<td style="width: 20%;text-align:left"><img src="${fns:getConfig('domain')}${attachment.filePath}?imageView2/2/w/200" style="height: 127px;width: 200px" onclick="viewPhoto(this)"></td>
						</c:if>
					</c:forEach>
				</tr>

		</table>

		<c:if test="${vaccine.auditStatus == '3'}">
			<table class="tableStyle" formMode="view" style="width: 98%;margin-left: 1%">
				<div class="little-title"><img src="${ctxStatic}/images/bohui.png" style="width: 25px;height:25px;"/>&nbsp;&nbsp;驳回原因</div>
				<tr>
					<%--<td class="td_right viewModeEven">驳回原因：</td>--%>
					<td class="td_left">${vaccine.audit.auditOpinion}</td>
				</tr>
			</table>
		</c:if>
		<c:if test="${vaccine.auditStatus == '2'}">
			<table class="tableStyle" formMode="view" style="width: 98%;margin-left: 1%">
				<div class="little-title"><img src="${ctxStatic}/images/bohui.png" style="width: 25px;height:25px;"/>&nbsp;&nbsp;驳回原因</div>
				<tr>
					<%--<td class="td_right viewModeEven">驳回原因：</td>--%>
					<td class="td_left">${vaccine.audit.auditOpinion}</td>
				</tr>
			</table>
		</c:if>
	</form:form>
</body>
</html>